/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package edu.upf.Ilusio.messaging;

import edu.upf.Ilusio.Entities.Picture;
import edu.upf.Ilusio.Interfaces.Listener;
import java.lang.String;
import java.util.Date;
import org.jivesoftware.smack.packet.Message;
import org.jivesoftware.smack.packet.Packet;

/**
 *
 * @author xday666
 */
public class ChatListener implements Listener {

    IM im, im2;

    public ChatListener(IM instancem) {
        im = instancem;
    }

    public void processPacket(Packet packet) {
        if (packet instanceof Message) {

            
            Message msg = (Message) packet;
            im.addText(msg.getFrom(), msg.getBody());


        }
    }
}
